//
//  NetworkTool.h
//  Medicine
//
//  Created by Just-h on 16/5/30.
//  Copyright © 2016年 JUST-Hychen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RequestMessage.h"
#import "ResponseMessage.h"
#import "TypeDef.h"
#import "UserInfoModel.h"
#import "MessageFactory.h"

@interface NetworkTool : NSObject
@property(nonatomic,copy) NSString *successInfo;
@property(nonatomic,copy) NSString *failInfo;
+ (instancetype)sharedNetworkTool;

/**
 *  通用请求数据接口(记录类型)
 *
 *  @param params  参数数组
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)requestDataWithParams:(NSArray *)params authType:(AuthModel)authType dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;

- (void)requestDataNoMessageWithParams:(NSArray *)params authType:(AuthModel)authType dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;

- (void)requestDataNoHudWithParams:(NSArray *)params authType:(AuthModel)authType dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;

//请求javabean接口
- (void)requestJavaBeanDataWithParams:(NSArray *)params authType:(AuthModel)authType dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;

- (void)reportTraceDataWithParams:(NSArray *)params authType:(AuthModel)authType dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;
/**
 *  登录接口
 *
 *  @param params  参数数组
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)requestLoginWithParams:(NSArray *)params Success:(void (^)(UserInfoModel *model))success Failure:(void (^)(NSString *code,NSString *msg))failure;

/**
 *  请求验证码接口
 *
 *  @param phoneNum 用户手机号
 *  @param type     类型
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)requestValidCodeWithPhoneNum:(NSString *)phoneNum type:(NSString *)type Success:(void (^)(id obj))success Failure:(void (^)(NSString *code,NSString *msg))failure;


/**
 *  上传DeviceToken
 */
//- (void)uploadDeviceTokenWithParams:(NSArray *)params dataType:(DataType)dataType Success:(void (^)(id obj))success Failure:(void (^)())failure;


/**
 *  上传头像
 *
 *  @param params  参数
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)uploadIconImgWithParams:(NSArray *)params Img:(UIImage *)img Success:(void (^)(id obj))success Failure:(void (^)())failure;


- (void)uploadImageArray:(NSArray *)imageArray params:(NSArray *)params Success:(void (^)(id obj))success Failure:(void (^)())failure;

/**
 获取App基本信息(图片地址前缀,AppStore版本号,AppStore版本号对应描述)

 @param success 成功回调
 @param failure 失败回调
 */
//- (void)requestAppBaseConfigWithSuccess:(void (^)(NSString *url,NSString *version,NSString *versionDesc))success Failure:(void (^)())failure;
@end
